/**
* GtkWrapBoxPacking:
* @GTK_WRAP_BOX_H_EXPAND: Whether the child expands horizontally.
- * @GTK_WRAP_BOX_H_FILL: Whether the child fills its allocated horizontal space.
* @GTK_WRAP_BOX_V_EXPAND: Whether the child expands vertically.
- * @GTK_WRAP_BOX_V_FILL: Whether the child fills its allocated vertical space.
*
- * Specifies how widgets will expand/fill vertically and
+ * Specifies how widgets will expand vertically and
* horizontally when placed inside a #GtkWrapBox.
*/
typedef enum
{
GTK_WRAP_BOX_H_EXPAND = 1 << 0,
- GTK_WRAP_BOX_H_FILL = 1 << 1,
- GTK_WRAP_BOX_V_EXPAND = 1 << 2,
- GTK_WRAP_BOX_V_FILL = 1 << 3
+ GTK_WRAP_BOX_V_EXPAND = 1 << 1
} GtkWrapBoxPacking;
child_allocation.height = item_size;
}
- request_mode = gtk_size_request_get_request_mode (GTK_SIZE_REQUEST (child->widget));
- if (!(child->packing & GTK_WRAP_BOX_H_FILL))
- {
- gint width, height;
-
- if (!(child->packing & GTK_WRAP_BOX_V_FILL) && request_mode == GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT)
- {
- gtk_size_request_get_height (GTK_SIZE_REQUEST (child->widget), NULL, &height);
-
- height = MIN (child_allocation.height, height);
- }
- else
- height = child_allocation.height;
-
- if (request_mode == GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT)
- gtk_size_request_get_width_for_height (GTK_SIZE_REQUEST (child->widget),
- height, NULL, &width);
- else
- gtk_size_request_get_width (GTK_SIZE_REQUEST (child->widget), NULL, &width);
-
- width = MIN (child_allocation.width, width);
- child_allocation.x = child_allocation.x + (child_allocation.width - width) / 2;
- child_allocation.width = width;
- }
-
- if (!(child->packing & GTK_WRAP_BOX_V_FILL))
- {
- gint height;
-
- /* Note here child_allocation.width is already changed if (!(child->packing & GTK_WRAP_BOX_H_FILL)) */
- if (request_mode == GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH)
- gtk_size_request_get_height_for_width (GTK_SIZE_REQUEST (child->widget),
- child_allocation.width, NULL, &height);
- else
- gtk_size_request_get_height (GTK_SIZE_REQUEST (child->widget), NULL, &height);
-
- height = MIN (child_allocation.height, height);
- child_allocation.y = child_allocation.y + (child_allocation.height - height) / 2;
- child_allocation.height = height;
- }
-
gtk_widget_size_allocate (child->widget, &child_allocation);
}
/* fit_aligned_item_requests() helper */
static gint
-gather_aligned_item_requests (GtkWrapBox *box,
- GtkOrientation orientation,
+gather_aligned_item_requests (GtkWrapBox *box,
+ GtkOrientation orientation,
gint line_length,
gint item_spacing,
gint n_children,
static GtkOrientation text_orientation = GTK_ORIENTATION_HORIZONTAL;
static gboolean items_xexpand = TRUE;
static gboolean items_yexpand = TRUE;
-static gboolean items_xfill = TRUE;
-static gboolean items_yfill = TRUE;
static void
gtk_wrap_box_insert_child (GTK_WRAP_BOX (wrapbox), frame, -1,
(items_xexpand ? GTK_WRAP_BOX_H_EXPAND : 0) |
- (items_yexpand ? GTK_WRAP_BOX_V_EXPAND : 0) |
- (items_xfill ? GTK_WRAP_BOX_H_FILL : 0) |
- (items_yfill ? GTK_WRAP_BOX_V_FILL : 0));
+ (items_yexpand ? GTK_WRAP_BOX_V_EXPAND : 0));
g_free (text);
}
gtk_wrap_box_insert_child (GTK_WRAP_BOX (wrapbox), frame, -1,
(items_xexpand ? GTK_WRAP_BOX_H_EXPAND : 0) |
- (items_yexpand ? GTK_WRAP_BOX_V_EXPAND : 0) |
- (items_xfill ? GTK_WRAP_BOX_H_FILL : 0) |
- (items_yfill ? GTK_WRAP_BOX_V_FILL : 0));
+ (items_yexpand ? GTK_WRAP_BOX_V_EXPAND : 0));
}
}
gtk_wrap_box_insert_child (GTK_WRAP_BOX (wrapbox), widget, -1,
(items_xexpand ? GTK_WRAP_BOX_H_EXPAND : 0) |
- (items_yexpand ? GTK_WRAP_BOX_V_EXPAND : 0) |
- (items_xfill ? GTK_WRAP_BOX_H_FILL : 0) |
- (items_yfill ? GTK_WRAP_BOX_V_FILL : 0));
+ (items_yexpand ? GTK_WRAP_BOX_V_EXPAND : 0));
}
}
G_CALLBACK (text_orientation_changed), wrapbox);
- /* Add expand/fill options */
+ /* Add expand options */
hbox = gtk_hbox_new (FALSE, 2);
gtk_widget_show (hbox);
G_CALLBACK (child_option_toggled), &items_xexpand);
- widget = gtk_check_button_new_with_label ("X Fill");
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
- gtk_widget_show (widget);
-
- gtk_widget_set_tooltip_text (widget, "Set whether the items fill their allotted size horizontally");
- gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0);
-
- g_signal_connect (G_OBJECT (widget), "toggled",
- G_CALLBACK (child_option_toggled), &items_xfill);
-
- gtk_box_pack_start (GTK_BOX (items_cntl), hbox, FALSE, FALSE, 0);
-
-
- hbox = gtk_hbox_new (FALSE, 2);
- gtk_widget_show (hbox);
-
widget = gtk_check_button_new_with_label ("Y Expand");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
gtk_widget_show (widget);
g_signal_connect (G_OBJECT (widget), "toggled",
G_CALLBACK (child_option_toggled), &items_yexpand);
-
- widget = gtk_check_button_new_with_label ("Y Fill");
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
- gtk_widget_show (widget);
-
- gtk_widget_set_tooltip_text (widget, "Set whether the items fill their allotted size vertically");
- gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0);
-
- g_signal_connect (G_OBJECT (widget), "toggled",
- G_CALLBACK (child_option_toggled), &items_yfill);
-
gtk_box_pack_start (GTK_BOX (items_cntl), hbox, FALSE, FALSE, 0);
populate_items (GTK_WRAP_BOX (wrapbox));